<?php
if(isset($_COOKIE['email']))//nếu tồn tại cookie username
{
	header("location:index.php");
}else //nếu chưa click vào checkbox từ lần đăng nhập trước: Hiển thị form đăng nhập.
{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>...:: eManazines ::...</title>
    <link rel="Stylesheet" href="css/style.css" type="text/css" />
    <link rel="Stylesheet" href="css/mystyle.css" type="text/css" />
<link href="scripts/mrk.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="scripts/jquery-1.4.4.min.js"></script>

<script type="text/javascript" src="scripts/mrk.js"></script>

<script language="javascript" type="text/javascript" src="scripts/CLEditor1_2/jquery.cleditor.min.js"></script> 

<link href="scripts/CLEditor1_2/jquery.cleditor.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?php require_once("function.php") ?>
    <div class="wrapper">
    <?php include ("top.php");?>
        <div class="body">
        <?php

    $url ="http://vnexpress.net";

    $content = MyFunctions::get_content_by_url($url);

    $content = MyFunctions::get_content_by_tag($content,"<div id=\"content\">",$url);

    $list = MyFunctions::list_all_link($content,$url);  

?> 
        <div class="content_vnexpress">
          <table width="800" border="0" cellspacing="0" cellpadding="1">
            <tr>
              <td width="98">&nbsp;</td>
              <td width="698"><p class="text-1">Các tin lấy được từ vnexpress.net ngày
                    <script type="text/javascript" src="scripts/HienNgayHomNay.js"></script>
              </p>
<p>
                    <select id="lienket" name="lienket">
                      <option value="">-------- Xin chọn loại tin ---------</option>
                      <?php

            for ($i=0; $i<count($list); $i++){

                                    $class = $list[$i]['class'];

                                    if($class=="link-folder"){

                                                if($i==0){

                                                            echo "<optgroup label=\"".$list[$i]['title']."\">\n";

                                                }else{

                                                            echo "</optgroup><optgroup label=\"".$list[$i]['title']."\">\n";                               

                                                }          

                                    }else if($class!='link-subfolder'){

                                                echo "<option value=\"".$list[$i]['href']."\">".$list[$i]['title']."</option>\n";

                                    }

                        }

                        echo "</optgroup>";

            ?>
                                        </select>
                </p></td>
            </tr>
            <tr>
              <td class="text-3">url của tin:</td>
              <td><label>
                <input name="diachi" type="text" id="diachi" size="50" />
              </label></td>
            </tr>
            <tr>
              <td class="text-3">Tiêu đề:</td>
              <td><label>
                <input name="tieude" type="text" id="tieude" size="50" />
              </label></td>
            </tr>
            <tr>
              <td class="text-3">Tóm tắt:</td>
              <td><label>
                <textarea name="tomtat" id="tomtat" cols="50" rows="5"></textarea>
              </label></td>
            </tr>
            <tr>
              <td class="text-3">Hình mô tả:</td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td class="text-3">Nội dung:</td>
              <td><label>
                <textarea name="noidung" id="noidung" cols="50" rows="10"></textarea>
              </label></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td><label>
                <input type="submit" name="save" id="save" value="Save" />
              </label></td>
            </tr>
          </table>
          <p>&nbsp;</p>
          </div>
          <div class="vide">
            </div>
        </div>
        <?php include ("footer.php");?>
    </div>
</body>
</html>
<?php
}// end else
?>
